package com.demon.androidbasic.action

import androidx.annotation.StringRes
import com.blankj.utilcode.util.ToastUtils

/**
 * author : Android 轮子哥
 * github : https://github.com/getActivity/AndroidProject
 * time   : 2019/12/08
 * desc   : 吐司意图
 */
interface ToastAction {
    fun toast(text: CharSequence?) {
        if (!text.isNullOrEmpty()) {
            ToastUtils.showShort(text)
        }
    }

    fun toast(@StringRes id: Int) {
        ToastUtils.showShort(id)
    }

    fun toastLong(text: CharSequence?) {
        if (!text.isNullOrEmpty()) {
            ToastUtils.showLong(text)
        }
    }

    fun toastLong(@StringRes id: Int) {
        ToastUtils.showLong(id)
    }
}